﻿using System;
using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Game.Contract.Action;
using ZyGames.Framework.Game.Lang;
using ZyGames.Framework.Game.Service;
using System.Linq;
using ZyGames.DZPocker.Bll.Logic;
using ZyGames.DZPocker.Script;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 开局广播所有玩家的剩余筹码(紧接着30003后面广播)
	/// </summary>
	public class Action20020 : BaseAction
	{
		private int tableId;
		/// <summary>
		/// 所有有玩家在玩的位置的筹码集合List<PositionChipData>
		/// </summary>
		private string posChipListString;
		public Action20020(HttpGet actionGetter)
			: base((short)ActionType.DZBroadCastAllGameUserChip, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetInt("TableId", ref tableId) &&
				httpGet.GetString("PositionsChipListString", ref posChipListString))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(tableId);
			this.PushIntoStack(posChipListString);
		}
	}
}
